
import { Entity, NgField, NgObject, EntityList, NgList, NgDynamic, DynamicEntity, NgEntity } from '@farris/devkit';
import { BXMXEntity } from './bxmxentity';
import { BXFJEntity } from './bxfjentity';
import { BillStateD324Entity } from './billstated324entity';
import { ProcessInstance3f54Entity } from './processinstance3f54entity';
import { GspUser6a00Entity } from './gspuser6a00entity';
import { SysOrg8facEntity } from './sysorg8facentity';
import { GspUser31a0Entity } from './gspuser31a0entity';

@NgEntity({
    originalCode: "ROBXD",
    nodeCode: "robxds"
})
export class ROBXDEntity extends Entity {

    @NgField({
        originalDataField: 'ID',
        dataField: 'id',
        primary: true,
        originalDataFieldType: 'String',
        initValue: '',
        path: 'ID',

        validRules: [
            {
                type: 'required',
                constraints: [true],
            },
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    id: string;

    @NgField({
        originalDataField: 'Version',
        dataField: 'version',
        originalDataFieldType: 'DateTime',
        initValue: '0001-01-01T00:00:00',
        path: 'Version',
        enableTimeZone: true,
    })
    version: string;

    @NgField({
        originalDataField: 'BillCode',
        dataField: 'billCode',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'BillCode',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    billCode: string;

    @NgField({
        originalDataField: 'TotalSum',
        dataField: 'totalSum',
        originalDataFieldType: 'Number',
        initValue: 0,
        path: 'TotalSum',
    })
    totalSum: any;

    @NgField({
        originalDataField: 'BillType',
        dataField: 'billType',
        originalDataFieldType: 'Enum',
        defaultValue: '',
        initValue: 'CL',
        path: 'BillType',
    })
    billType: any;

    @NgField({
        originalDataField: 'BillDate',
        dataField: 'billDate',
        originalDataFieldType: 'DateTime',
        initValue: '0001-01-01T00:00:00',
        path: 'BillDate',
        enableTimeZone: true,
    })
    billDate: string;

    @NgField({
        originalDataField: 'ProjectID',
        dataField: 'projectID',
        originalDataFieldType: 'String',
        initValue: '',
        path: 'ProjectID',

        validRules: [
            {
                type: 'maxLength',
                constraints: [36],
                message: '最大长度为36',
            }
        ]
    })
    projectID: string;

    @NgField({
        originalDataField: 'BillNote',
        dataField: 'billNote',
        originalDataFieldType: 'Text',
        initValue: '',
        path: 'BillNote',
    })
    billNote: any;

    @NgField({
        originalDataField: 'AuditStatus',
        dataField: 'auditStatus',
        originalDataFieldType: 'Enum',
        defaultValue: '',
        initValue: 'None',
        path: 'AuditStatus',
    })
    auditStatus: any;

    @NgList({
        dataField: 'bxmxs',
        originalDataField: '',
        type: BXMXEntity

    })

    bxmxs: EntityList<BXMXEntity>;
    @NgList({
        dataField: 'bxfjs',
        originalDataField: '',
        type: BXFJEntity

    })

    bxfjs: EntityList<BXFJEntity>;
    @NgObject({
        dataField: 'billStatus',
        originalDataField: 'BillStatus',
        type: BillStateD324Entity
    })
    billStatus: BillStateD324Entity;
    @NgObject({
        dataField: 'processInstance',
        originalDataField: 'ProcessInstance',
        type: ProcessInstance3f54Entity
    })
    processInstance: ProcessInstance3f54Entity;
    @NgObject({
        dataField: 'employeeID',
        originalDataField: 'EmployeeID',
        type: GspUser6a00Entity
    })
    employeeID: GspUser6a00Entity;
    @NgObject({
        dataField: 'domainID',
        originalDataField: 'DomainID',
        type: SysOrg8facEntity
    })
    domainID: SysOrg8facEntity;
    @NgObject({
        dataField: 'projectMrg',
        originalDataField: 'ProjectMrg',
        type: GspUser31a0Entity
    })
    projectMrg: GspUser31a0Entity;
}